package com.maomao.maomaochong_i.quanxing.Adpater;

import com.maomao.maomaochong_i.global.Show;
import com.maomao.maomaochong_i.quanxing.Phone;
import com.maomao.maomaochong_i.quanxing.PhoneData.PhoneData;
import com.maomao.maomaochong_i.quanxing.ShanPingShuJu;
import com.maomao.maomaochong_i.quanxing.Xiugai;
import com.maomao.maomaochong_i.quanxing.YingYong;

import java.util.ArrayList;

/**
 * Created by Mrma on 17.5.19.
 */

public class SecondPhoneAdpter implements YingYong,Xiugai {
    public Phone quanxingsj;

    public PhoneData PhoneData;

    private static SecondPhoneAdpter gwc;
    private  ArrayList<ShanPingShuJu> getlist;

    public ArrayList<ShanPingShuJu> getGetlist() {
        return getlist;
    }

    public static SecondPhoneAdpter getOne(){
        return gwc;
    }

    public static SecondPhoneAdpter getOne(Phone quanxingsj){
        if(gwc == null){
            gwc = new SecondPhoneAdpter(quanxingsj);
        }
        return gwc;
    }

    private SecondPhoneAdpter(Phone quanxingsj){
        this.quanxingsj = quanxingsj;
        quanxingsj.tianjia(this);

    }

    @Override
    public void play() {
        PhoneData.classfiy(Show.SENCONEDPHOE);
        getlist = PhoneData.getList();
        System.out.println("旧："+getlist.get(0));
    }


    @Override
    public void xiugai(PhoneData PhoneData) {
        this.PhoneData = PhoneData;
        play();
    }
}

